package net.oschina.esb.webmvc.auto.parameter;

import net.oschina.esb.webmvc.util.RequestUtil;

import javax.servlet.http.HttpServletRequest;

/**
 * 获取用户请求协议，通过 Nginx 请求头： proxy_set_header X-Forwarded-Scheme $scheme
 *
 * @author Arvin
 * @time 2018/5/6 16:39
 */
public class ProtocolPageParameter implements PageParameter {
    @Override
    public String getName() {
        return "protocol";
    }

    @Override
    public String getValue(HttpServletRequest request) {
        return RequestUtil.getProtocol(request);
    }
}
